<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">  
<meta charset="UTF-8">
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/>
	<link href="css/reg.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="css/base.css" type="text/css"/>
	<link rel="stylesheet" href="css/headbott.css" type="text/css"/>
	<link rel="stylesheet" href="css/index.css" type="text/css"/>
	<link rel="stylesheet" href="css/ly-list.css" type="text/css"/>
	<link rel="stylesheet" href="css/reg.css" type="text/css"/>
	<link rel="stylesheet" href="css/toastr.css" />
	
	<title></title>
</head>
<body>
<div id="header">
	<div class="heade-con">
		<div class="logo"><a href=""><img src="images/LOGO.png"/></a></div>
		<div class="nav posa">
			<ul>
				<li><a href="index.do">首页</a></li>
				<li><a href="gyzc-list.do">公益众筹</a></li>
				<li><a href="cop.do">常见问题</a></li>
				<li><a href="ly-list.do">众筹资讯</a></li>
				<li><a class="vcolor" href="new_product.do" style="">发布项目</a></li>
			</ul>
		</div>
		<div class="search">
			<form action="">
				<input type="text" class="search-txt" value="" placeholder="找项目">
				<input type="submit" class="search-but" value="">
			</form>
		</div>
		<div class="index-login">
 			<c:choose>
				<c:when test="${tbUser2==null}">
				<a href="login.do">			
				登录
				</a> 
				<span style="color: white;">|</span> 
				<a href="regist.do">注册</a>
				</c:when>
				<c:otherwise>
						<div >
						<span style="color: white;"><a href="user.do">${tbUser2.usAccount}</a></span> 
						<span style="color: white;"><a href="Users/quit.do">退出</a></span> 
						</div>
				</c:otherwise>
			</c:choose>

		</div>
	</div>
</div>
<!--上不导航栏结束-->
<!--中间核心-->
<div class="product">
	<!--头上表格-->
	<div class="product-table">
		<div class="product-left">
			<table class="table table-bordered">
				<tr class="text-center">
					<td class="active title-td"><a href="new_product.do">基本信息</a></td>
					<td class="title-td"><a href="new_info.do">项目信息</a></td>
					<td class="title-td"><a href="new_detail.do">详细描述</a></td>
					<td class="title-td"><a href="new_back.do">回报设置</a></td>
				</tr>
			</table>
		</div>
		<div class="product-right">
			<table class="table table-bordered">
				<tr class="text-center">
					<td class="title-td">预览</td>
				</tr>

			</table>

		</div>
	</div>
	<!--下部foem表单-->
	<div class="product-form">
		<!--上标题-->
		<div class="product-title">
			<div class="my-h4">
				<h4>选择你的身份类型</h4>
			</div>
			<div class="btn-save">
				<button class="btn btn-default" id="btn1" type="button">保存草稿</button>
			</div>

		</div>
		<div class="clear"></div>
		<hr>
		<!--选择机构个人-->
		<div class="choose">
			<table class="table table-bordered">
				<tr class="text-center">
					<td class="choose-td" style="background: #00aced">个人</td>
				</tr>
			</table>
		</div>
		<!--表单-->
		<form>
			<div class="my-form text-center">

				<div class="product-input"><input class="text" type="text"  id="i1" value="${tbUser2.usAccount} " readonly="readonly"></div>
				<div class="product-input"><input class="text" type="text"  id="i2" value="${tbUser2.usIdcard}" readonly="readonly"></div>
				<div class="product-input"><input class="text" type="text" placeholder="请输入手机号码"  id="i3"></div>

				<div class="product-input"><input class="text" type="text" placeholder="客服联系人"  id="i4"></div>
				<div class="product-input"><input class="text" type="text" placeholder="客服咨询电话"  id="i5"></div>
			</div>

			
			<div class="product-select">
			<div id="city_2">
				<div class="product-select1">
					<select class="prov" name="userAddress" id="s1"></select> 
				</div>
				<div class="product-select2">
					<select class="city" disabled="disabled" name="userAddress1" id="s2"></select>
				</div>
				</div>
			</div>
			
			<div class="product-select">
				<div class="select-type">
					<select class="select-cla" id="s3">
						<option>请选择</option>
						<option>教育助学</option>
						<option>爱心环保</option>
						<option>扶贫助困</option>
						<option>公益创业</option>
						<option>公益活动</option>
					</select>
				</div>
			</div>
		</form>
	</div>
</div>
<!--底部开始-->
<div id="bottom">
	<div class="bottom-ggt"><a href=""><img src="images/bottbom_68.jpg" alt=""/></a></div>
	<div class="zc-yqlink">
		<ul>
			<li><a href="">阿里巴巴集团</a></li>
			<li><a href="">淘宝网</a></li>
			<li><a href="">天猫</a></li>
			<li><a href="">聚划算</a></li>
			<li><a href="">全球速卖通</a></li>
			<li><a href="">阿里巴巴国际交易市场</a></li>
			<li><a href="">1688</a></li>
			<li><a href="">阿里妈妈</a></li>
			<li><a href="">阿里旅行</a></li>
			<li><a href="">阿里云计算</a></li>
			<li><a href="">阿里巴巴集团</a></li>
			<li><a href="">淘宝网</a></li>
			<li><a href="">天猫</a></li>
			<li><a href="">聚划算</a></li>
			<li><a href="">全球速卖通</a></li>
			<li><a href="">阿里巴巴国际交易市场</a></li>
			<li><a href="">1688</a></li>
			<li><a href="">阿里妈妈</a></li>
			<li><a href="">阿里云计算</a></li>
		</ul>
	</div>
	<div class="footer-bd">

		<a href=" ">关于淘宝</a>
		<a href=" ">合作伙伴</a>
		<a href=" ">营销中心</a>
		<a href=" ">廉正举报</a>
		<a href=" ">联系客服</a>
		<a href=" ">开放平台</a>
		<a href=" ">诚征英才</a>
		<a href=" ">联系我们</a>
		<a href=" ">网站地图</a>
		<a href=" ">法律声明</a>　　　
		<em>© 2003-2015 Taobao.com 版权所有</em><br>

		<br>
		<span>网络文化经营许可证：<a href=" ">浙网文[2013]0268-027号</a></span>
		<b>|</b>
		<span data-spm-protocol="i">增值电信业务经营许可证：<a href="">浙B2-20080224-1</a></span>
		<b>|</b>
		<span>信息网络传播视听节目许可证：1109364号</span>
		<b>|</b>
		<span>举报电话:0571-81683755</span>
	</div>
</div>
</body>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/toastr.js"></script>
<script type="text/javascript" src="js/jquery.cityselect.js"></script>
<script type="text/javascript">
	$("#btn1").click(function(){
		var i1 = $("#i1").val();
		var i2 = $("#i2").val();
		var i3 = $("#i3").val();
		var i4 = $("#i4").val();
		var i5 = $("#i5").val();
		
		var s1 = $("#s1").val();
		var s2 = $("#s2").val();
		var s3 = $("#s3").val();
		var user_id = "1";     //${user.id}
		var Account = /^[\u4E00-\u9FA5]{2,6}$/; //客服联系人
		var phone = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/; //手机号
		if(user_id==""){
			toastr.error("请登录后再试");
		}else
			
		if(i3==null||!phone.test(i3)){
			toastr.error("请输入正确的手机号");
		}
		else if(i4==null||!Account.test(i4)){
			toastr.error("请输入中文姓名，2-6个汉字"); 
		}
		else if(s1=="---请选择---"||s2=="---请选择---"){
			toastr.error("请选择正确的地址");
		}else if(s3=="请选择"){
			toastr.error("请选择项目分类");
		
		}else if(s3=="教育助学"){
			psPstId = 1;
			gogogo(user_id,i1,i2,i3,i4,i5,s1,s2,psPstId);
		
		}else if(s3=="爱心环保"){
			psPstId = 2;
			gogogo(user_id,i1,i2,i3,i4,i5,s1,s2,psPstId);
		
		}else if(s3=="扶贫助困"){
			psPstId = 3;
			gogogo(user_id,i1,i2,i3,i4,i5,s1,s2,psPstId);
		
		}else if(s3=="公益创业"){
			psPstId = 4;
			gogogo(user_id,i1,i2,i3,i4,i5,s1,s2,psPstId);
		
		}else if(s3=="公益活动"){
			psPstId = 5;
			gogogo(user_id,i1,i2,i3,i4,i5,s1,s2,psPstId);
		}
	})
		function gogogo(user_id,i1,i2,i3,i4,i5,s1,s2,psPstId){
			var s = s1+s2;
			$.ajax({
				url:"progo1.do",
				type:"post",
				data:{"usId":user_id,"usAccount":i1,"usIdcard":i2,"usPhone":i3,"psCustName":i4,"psCustPhone":i5,"psCustAddress":s,"psPstId":psPstId},
				success:function(data){
					if(data=="-1"){
						toastr.error("保存失败，请重新尝试");
					}else if (data!="-1"){
						toastr.success("保存草稿成功");
						setTimeout(function(){window.location.href="new_info.do"},600);
					}
				},
				error:function(data){
					toastr.error("网络繁忙，请稍后再试");
				},
			})
		}
	$(function() {
		$("#city_2").citySelect({
			prov : "---请选择---",
			city : "---请选择---"
		});
	});

</script>
</html>